import {importStores} from 'zbee-webpack';
import {Search} from '@element-plus/icons-vue';
const {
	useTableStore,
} = importStores();
import {main} from './index.module.scss'

export default {
    useWidgets:[
        'text',
        'image',
        'horizontalLayout'
    ],
    body: {
        class:main,
        widget: "horizontalLayout",
        mode: 'flex',
        items: [
            {
                widget:'input',  // 定义组件
                id:'input',
                template: true,  // 是否复合型输入框
                clearable:'true',
                suffixIcon: Search,  // 插槽位置
            },
            {
                widget: 'button',
                text:'搜索',
                type:'primary',
                onClick:[
                {
                    action:'set',
                    value:'$widgets.input',
                    var:'dataRow'
                },{
                    action:'print',
                    data:'$vars.dataRow'
                },
                {
                    action:'store',
                    useStore:useTableStore,
                    method:'search',
                    params:'$vars.dataRow'
                }]
            },
            {
                widget:'button',
                text:'删除',
                onClick:[{
                    // var:'row',
                    // action:'store',
                    // useStore:useTableStore,
                    // method:'createDirtyRow'
                },{
                    // action:'call',
                    // function:'startEditRow',
                    // params:'$vars.row',
                    // scope:'$widgetRefs.table'
                }]
            },
            {
                widget: 'select',  // 定义组件
                useStore: useTableStore,  //定义目标数据
             },
        ]
    }
}